﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cherry.Agile.ServiceModel.Runtime;

namespace Cherry.Agile.ServiceModel.Services {
    public class AssemblyFilter : ServiceFilter {
        HashSet<string> _assemblyNames = new HashSet<string>();
        public AssemblyFilter(string[] assemblies) {
            foreach (var item in assemblies) {
                _assemblyNames.Add(item);
            }
        }
        public override bool Match(IService test) {
            var name = test.ServiceType.Assembly.FullName.Split(',')[0];
            return _assemblyNames.Contains(name);
        }
    }
}
